package com.zhuss.core.processor;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;

import com.zhuss.bean.vo.core.diss.DetailDissVo;
import com.zhuss.enums.StartStopEnum;
import com.zhuss.exception.DzcxException;


@Component("dissCheck")
public class DissCheck {
	
	@Autowired
	@Qualifier("dissRead")
	private DissRead dissRead;

	
	public boolean checkStart(Long dissId) throws DzcxException {
		DetailDissVo diss = ((DetailDissVo) dissRead.detail(dissId));
		if (StartStopEnum.停用.sameKey(diss.getStatus())) {
			return true;
		}
		return false;
	}
	
	public boolean checkStop(Long dissId) throws DzcxException {
		DetailDissVo diss = ((DetailDissVo) dissRead.detail(dissId));
		if (StartStopEnum.启用.sameKey(diss.getStatus())) {
			return true;
		}
		return false;
	}
	
}
